import requests
import re
print("sadsadsasasasasasa")


# login_url = "http://127.0.0.1:8000/admin/login/?next=/admin/login"
# response_login = requests.get(login_url)
#
#
# csrfmiddlemaretoken = re.search(r'name="csrfmiddlewaretoken" value="(.*?)"',response_login.text)
# print(csrfmiddlemaretoken)
#
# response_login = requests.post(login_url,data={
#     "username":"fyx",
#     "password":"123456",
#     "csrfmiddlewaretoken":csrfmiddlemaretoken.group(1)
# },cookies = response_login.cookies)
#
# print(response_login.text)


# login_url = "http://127.0.0.1:8000/admin/login/?next=/admin/login"
# session = requests.Session()
# print(session.cookies)
# response= session.get(login_url)
# csrfmiddlemaretoken = re.search(r'name="csrfmiddlewaretoken" value="(.*?)"',response.text)
# print(csrfmiddlemaretoken)
#
# response = session.post(login_url,data={
#     "username":"fyx",
#     "password":"123456",
#     "csrfmiddlewaretoken":csrfmiddlemaretoken.group(1)
# })
# print(response.text)